package com.juc.forkJoinPool.forkJoinPool9;

import java.util.concurrent.ForkJoinPool;

public class Test2 {

	//shutdown() 方法任务依然运行，直到结束
	public static void main(String[] args) throws InterruptedException {
		MyRunnable1 myRunnable = new MyRunnable1();
		ForkJoinPool pool =new ForkJoinPool();
		pool.submit(myRunnable);
		Thread.sleep(1000);
		pool.shutdown();
		System.out.println("main end! ");
		System.out.println(Thread.currentThread().getName());
		//pool.shutdownNow(); 
		Thread.sleep(Integer.MAX_VALUE);
		
		//用shutdown 方法如果主线程不等启动的线程 会直接挂掉
		
	}
}
